package com.mikao.controller.activity;

import com.mikao.dto.bo.ReqDataTableDto;
import com.mikao.dto.bo.TicketForm;
import com.mikao.dto.vo.RspDataTableDto;
import com.mikao.entity.Ticket;
import com.mikao.service.TicketService;
import org.springframework.web.bind.annotation.*;


/**
 * @author kenny
 */
@RestController
@RequestMapping("/management")
public class TicketController {

    private TicketService ticketService;

    public TicketController(TicketService ticketService) {
        this.ticketService = ticketService;
    }

    @GetMapping("/ticketList")
    public RspDataTableDto<Ticket> ticketList(ReqDataTableDto reqDataTableDTO) {
        return ticketService.ticketList(reqDataTableDTO);
    }

    @PostMapping("/saveTicket")
    public void saveTicket(TicketForm ticketForm) {
        ticketService.saveTicket(ticketForm);
    }

    @PostMapping("/deleteTicket/{id}")
    public void deleteTicket(@PathVariable Long id) {
        ticketService.deleteTicket(id);
    }
}
